
#ifndef __UNIT_H__
#define __UNIT_H__

#include <sstream>
#include <string>

struct Unit
{
public:
	Unit(unsigned int ammountInBaseUnit, const char* pUnitName);
	unsigned int convertToBaseUnit(unsigned int ammount) const;

	void formatThisUnit( std::ostream &os, unsigned int &remainingAmmount) const;

	bool operator==( const Unit &unit ) const;
	

private:
	void stripUnit( unsigned int &ammountInThisUnit, unsigned int &remainingAmmount) const;
	void toString( std::ostream &os, unsigned int &ammountInThisUnit, unsigned int &remainingAmmount) const;

private:
	unsigned int ammountInBaseUnit_m;
	const char *pUnitName_m;

};

#endif

